using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace ConsoleApplication2.Models.Mapping
{
    public class so_GuarOeMap : EntityTypeConfiguration<so_GuarOe>
    {
        public so_GuarOeMap()
        {
            // Primary Key
            this.HasKey(t => new { t.Bill_Currency, t.vglbatch });

            // Properties
            this.Property(t => t.GuarantorID)
                .HasMaxLength(6);

            this.Property(t => t.GuarantorName)
                .HasMaxLength(110);

            this.Property(t => t.Bill_Currency)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);

            this.Property(t => t.patient__)
                .HasMaxLength(6);

            this.Property(t => t.Patient_Name)
                .HasMaxLength(80);

            this.Property(t => t.Cardnumber)
                .HasMaxLength(50);

            this.Property(t => t.Insured_Name)
                .HasMaxLength(50);

            this.Property(t => t.relation_Type)
                .HasMaxLength(50);

            this.Property(t => t.vglbatch)
                .IsRequired()
                .IsFixedLength()
                .HasMaxLength(50);

            // Table & Column Mappings
            this.ToTable("so_GuarOe");
            this.Property(t => t.GuarantorID).HasColumnName("GuarantorID");
            this.Property(t => t.voucher).HasColumnName("voucher");
            this.Property(t => t.GuarantorName).HasColumnName("GuarantorName");
            this.Property(t => t.Guar_CURRENCY).HasColumnName("Guar_CURRENCY");
            this.Property(t => t.Type).HasColumnName("Type");
            this.Property(t => t.Bill_Currency).HasColumnName("Bill_Currency");
            this.Property(t => t.Bill__).HasColumnName("Bill_#");
            this.Property(t => t.Bill_Date).HasColumnName("Bill_Date");
            this.Property(t => t.patient__).HasColumnName("patient_#");
            this.Property(t => t.Patient_Name).HasColumnName("Patient_Name");
            this.Property(t => t.Patient_Amount).HasColumnName("Patient_Amount");
            this.Property(t => t.Total).HasColumnName("Total");
            this.Property(t => t.closedout).HasColumnName("closedout");
            this.Property(t => t.Cardnumber).HasColumnName("Cardnumber");
            this.Property(t => t.Insured_Name).HasColumnName("Insured_Name");
            this.Property(t => t.relation_Type).HasColumnName("relation_Type");
            this.Property(t => t.Bill_Amount).HasColumnName("Bill_Amount");
            this.Property(t => t.Discount_Amount).HasColumnName("Discount_Amount");
            this.Property(t => t.vglbatch).HasColumnName("vglbatch");
        }
    }
}
